<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .y-carousel{
            width: 400px;
            border: 1px solid #ccc;
            overflow: hidden;
        }
        .y-carousel-content{
            width: 1600px;
            height: 400px;
            animation: carousel 5s linear 0s infinite;
        }
        .y-carousel-content img{
            display: inline-block;
            float: left;
            width: 400px;
            height: 100%;
        }
        @keyframes carousel{
            0%,10%{
                margin-left: 0;
            }
            30%,40%{
                margin-left: -400px;
            }
            60%,70%{
                margin-left: -800px;
            }
            90%,100%{
                margin-left: -1200px;
            }
        }
    </style> 
</head>
<body>
    <div class="y-carousel">
        <div class="y-carousel-content">
            <img src="http://www.w3school.com.cn/ui2017/icon6.png">
            <img src="http://www.w3school.com.cn/ui2017/icon5.png">
            <img src="http://www.w3school.com.cn/ui2017/icon4.png">
            <img src="http://www.w3school.com.cn/ui2017/icon6.png">
        </div>
    </div>
</body>
</html>